using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using System.Security.Policy;

namespace CES_Application.Telas
{
    public partial class Tela_VendaCartoes : DevComponents.DotNetBar.OfficeForm
    {
        private Uri link;
        public Tela_VendaCartoes()
        {
            InitializeComponent();
        }

        private void Tela_VendaCartoes_Load(object sender, EventArgs e)
        {
            link = new Uri(" https://www.mobilecard.com.br/login.do");
            webBrowser_Venda.Url = link;

        }

        private void webBrowser_Venda_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (webBrowser_Venda.Url == link)
            {
                webBrowser_Venda.Document.GetElementById("usuario").SetAttribute("Value", "bruno01");
                webBrowser_Venda.Document.GetElementById("senha").SetAttribute("Value", "b5t8k9w3");
                /*webBrowser_Venda.Document.GetElementById("subimt").Focus();
                webBrowser_Venda.Document.GetElementById("subimt").InvokeMember("click");*/
                HtmlElementCollection elc = this.webBrowser_Venda.Document.GetElementsByTagName("input");
                foreach (HtmlElement el in elc)
                {
                    if (el.GetAttribute("value").Equals("submit"))
                    {
                        el.InvokeMember("click");
                    }
                }
            }
        }
    }
}